Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Imaging thumbnail component to load thumbnails in parallel #2109

Merged
merged 13 commits into from
Jul 10, 2024

Conversation

iOvergaard
Copy link
Collaborator

Description

Adds a <umb-imaging-thumbnail> element to fetch and show thumbnails. This replaced manual logic in the Media picker, media picker modal, input-media, and media collection.

The thumbnail component also holds an IntersectionObserver to ensure the images are not fetched (neither the thumbnail URL nor the image resource) before they are visible.

Types of changes

  • New feature (non-breaking change which adds functionality)

Motivation and context

We want to achieve the following:

  1. Thumbnails are loaded in parallel
  2. Thumbnails are loaded in the same way across the application (shared logic)
  3. Thumbnails are only loaded when needed (intersected)
  4. The fallback logic is the same across
  5. Ensure good a11y for thumbnail figures
  6. Ensure images are loaded in the expected size and no bigger than what is needed

How to test?

  1. Upload more than a couple of rows of media to a folder in the Media Library
  2. Open DevTools and make sure only one row is visible
  3. Reload the page and check that only that row is being requested
  4. Scroll the page and check the next row is being loaded, etc.
  5. Test that thumbnails show up outside regular sections, e.g. in User or Packages

Considerations

  • Considered to change the object-fit from cover to contain to show the whole image. However, this has not been altered in this PR.

Copy link
Member

@leekelleher leekelleher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested out, works great! 🚀

@iOvergaard iOvergaard merged commit 6697f57 into main Jul 10, 2024
8 checks passed
@iOvergaard iOvergaard deleted the v14/feature/load-thumbnails-individually branch July 10, 2024 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants